﻿using Cirrious.MvvmCross.Interfaces.ViewModels;
using Cirrious.MvvmCross.WindowsPhone.Views;
using TeaLightV5.Foundation.UX.ViewModels;

namespace TeaLightV5.Foundation.Ux.WinPhone.Views
{
    public class EntityView<T> : MvxPhonePage<T>
        where T : class, IMvxViewModel
    {
        protected override void OnNavigatedFrom(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedFrom(e);

        }

        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            EntityViewModel baseViewModel = ViewModel as EntityViewModel;
            if (baseViewModel != null)
            {
                // todo Refactor ReloadModel
                baseViewModel.ReloadModel();
            }

        }


    }
}
